home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Programming / MiniGL / include / mgl / minigl.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-07  |  9.4 KB  |  527 lines

  1. /*
  2.  * $Id: minigl.h,v 1.1.1.1 2000/04/07 19:44:51 tfrieden Exp $
  3.  *
  4.  * $Date: 2000/04/07 19:44:51 $
  5.  * $Revision: 1.1.1.1 $
  6.  *
  7.  * (C) 1999 by Hyperion
  8.  * All rights reserved
  9.  *
  10.  * This file is part of the MiniGL library project
  11.  * See the file Licence.txt for more details
  12.  *
  13.  */
  14.  
  15. #ifndef __MINIGL_H_INLINES
  16. #define __MINIGL_H_INLINES
  17.  
  18. #ifndef MGLAPI
  19.     #if defined(__GNUC__)
  20.     #define MGLAPI static inline
  21.     #elif defined(__STORMC__)
  22.     #define MGLAPI __inline
  23.     #elif defined(__VBCC__)
  24.     #define MGLAPI
  25.     #endif
  26. #endif
  27.  
  28. #define CC mini_CurrentContext
  29.  
  30. MGLAPI void glAlphaFunc(GLenum func, GLclampf ref)
  31. {
  32.     GLAlphaFunc(CC, func, ref);
  33. }
  34.  
  35. MGLAPI void glBegin(GLenum mode)
  36. {
  37.     GLBegin(CC, mode);
  38. }
  39.  
  40. MGLAPI void glBindTexture(GLenum target, GLuint texture)
  41. {
  42.     GLBindTexture(CC, target, texture);
  43. }
  44.  
  45. MGLAPI void glBlendFunc(GLenum sfactor, GLenum dfactor)
  46. {
  47.     GLBlendFunc(CC, sfactor, dfactor);
  48. }
  49.  
  50. MGLAPI void glClear(GLbitfield mask)
  51. {
  52.     GLClear(CC, mask);
  53. }
  54.  
  55. MGLAPI void glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
  56. {
  57.     GLClearColor(CC, red, green, blue, alpha);
  58. }
  59.  
  60. MGLAPI void glClearDepth(GLclampd depth)
  61. {
  62.     GLClearDepth(CC, depth);
  63. }
  64.  
  65. MGLAPI void glColor3f(GLfloat red, GLfloat green, GLfloat blue)
  66. {
  67.     GLColor4f(CC, red, green, blue, 1.f);
  68. }
  69.  
  70. MGLAPI void glColor3fv(GLfloat *v)
  71. {
  72.     GLColor3fv(CC, v);
  73. }
  74.  
  75. MGLAPI void glColor3ubv(GLubyte *v)
  76. {
  77.     GLColor3ubv(CC, v);
  78. }
  79.  
  80. MGLAPI void glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
  81. {
  82.     GLColor4f(CC, red, green, blue, alpha);
  83. }
  84.  
  85. MGLAPI void glColor4fv(GLfloat *v)
  86. {
  87.     GLColor4fv(CC, v);
  88. }
  89.  
  90. MGLAPI void glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
  91. {
  92.     GLColor4ub(CC, red, green, blue, alpha);
  93. }
  94.  
  95. MGLAPI void glColor4ubv(GLubyte *v)
  96. {
  97.     GLColor4ubv(CC, v);
  98. }
  99.  
  100. MGLAPI void glCullFace(GLenum mode)
  101. {
  102.     GLCullFace(CC, mode);
  103. }
  104.  
  105. MGLAPI void glDeleteTextures(GLsizei n, const GLuint *textures)
  106. {
  107.     GLDeleteTextures(CC, n, textures);
  108. }
  109.  
  110. MGLAPI void glDepthFunc(GLenum func)
  111. {
  112.     GLDepthFunc(CC, func);
  113. }
  114.  
  115. MGLAPI void glDepthMask(GLboolean flag)
  116. {
  117.     GLDepthMask(CC, flag);
  118. }
  119.  
  120. MGLAPI void glDepthRange(GLclampd n, GLclampd f)
  121. {
  122.     GLDepthRange(CC, n, f);
  123. }
  124.  
  125. MGLAPI void glDisable(GLenum cap)
  126. {
  127.     MGLSetState(CC, cap, GL_FALSE);
  128. }
  129.  
  130. MGLAPI void glDrawBuffer(GLenum mode)
  131. {
  132.     GLDrawBuffer(CC, mode);
  133. }
  134.  
  135. MGLAPI void glEnable(GLenum cap)
  136. {
  137.     MGLSetState(CC, cap, GL_TRUE);
  138. }
  139.  
  140. MGLAPI void glEnd(void)
  141. {
  142.     GLEnd(CC);
  143. }
  144.  
  145. MGLAPI void glFinish(void)
  146. {
  147.     GLFinish(CC);
  148. }
  149.  
  150. MGLAPI void glFlush(void)
  151. {
  152.     GLFlush(CC);
  153. }
  154.  
  155. MGLAPI void glFogf(GLenum pname, GLfloat param)
  156. {
  157.     GLFogf(CC, pname, param);
  158. }
  159.  
  160. MGLAPI void glFogi(GLenum pname, GLint param)
  161. {
  162.     GLFogf(CC, pname, (GLfloat)param);
  163. }
  164.  
  165. MGLAPI void glFogfv(GLenum pname, GLfloat *param)
  166. {
  167.     GLFogfv(CC, pname, param);
  168. }
  169.  
  170. MGLAPI void glFrontFace(GLenum mode)
  171. {
  172.     GLFrontFace(CC, mode);
  173. }
  174.  
  175. MGLAPI void glFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)
  176. {
  177.     GLFrustum(CC, left, right, bottom, top, zNear, zFar);
  178. }
  179.  
  180. MGLAPI void glGenTextures(GLsizei n, GLuint *textures)
  181. {
  182.     GLGenTextures(CC, n, textures);
  183. }
  184.  
  185. MGLAPI GLenum glGetError(void)
  186. {
  187.     return GLGetError(CC);
  188. }
  189.  
  190. MGLAPI void glGetFloatv(GLenum pname, GLfloat *params)
  191. {
  192.     GLGetFloatv(CC, pname, params);
  193. }
  194.  
  195. MGLAPI const GLubyte * glGetString(GLenum name)
  196. {
  197.     return GLGetString(CC, name);
  198. }
  199.  
  200. MGLAPI void glHint(GLenum target, GLenum mode)
  201. {
  202.     GLHint(CC, target, mode);
  203. }
  204.  
  205. MGLAPI void glLoadIdentity(void)
  206. {
  207.     GLLoadIdentity(CC);
  208. }
  209.  
  210. MGLAPI void glLoadMatrixd(const GLdouble *m)
  211. {
  212.     GLLoadMatrixd(CC, m);
  213. }
  214.  
  215. MGLAPI void glLoadMatrixf(const GLfloat *m)
  216. {
  217.     GLLoadMatrixf(CC, m);
  218. }
  219.  
  220. MGLAPI void glMatrixMode(GLenum mode)
  221. {
  222.     GLMatrixMode(CC, mode);
  223. }
  224.  
  225. MGLAPI void glMultMatrixd(const GLdouble *m)
  226. {
  227.     GLMultMatrixd(CC, m);
  228. }
  229.  
  230. MGLAPI void glMultMatrixf(const GLfloat *m)
  231. {
  232.     GLMultMatrixf(CC, m);
  233. }
  234.  
  235. MGLAPI void glNormal3f(GLfloat x, GLfloat y, GLfloat z)
  236. {
  237.     GLNormal3f(CC, x, y, z);
  238. }
  239.  
  240. MGLAPI void glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)
  241. {
  242.     GLOrtho(CC, left, right, bottom, top, zNear, zFar);
  243. }
  244.  
  245. MGLAPI void glPixelStorei(GLenum pname, GLint param)
  246. {
  247.     GLPixelStorei(CC, pname, param);
  248. }
  249.  
  250. MGLAPI void glPolygonMode(GLenum face, GLenum mode)
  251. {
  252.     GLPolygonMode(CC, face, mode);
  253. }
  254.  
  255. MGLAPI void glPopMatrix(void)
  256. {
  257.     GLPopMatrix(CC);
  258. }
  259.  
  260. MGLAPI void glPushMatrix(void)
  261. {
  262.     GLPushMatrix(CC);
  263. }
  264.  
  265. MGLAPI void glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels)
  266. {
  267.     GLReadPixels(CC, x, y, width, height, format, type, pixels);
  268. }
  269.  
  270. MGLAPI void glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
  271. {
  272.     GLRotatef(CC, angle, x, y, z);
  273. }
  274.  
  275. MGLAPI void glRotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
  276. {
  277.     GLRotated(CC, angle, x, y, z);
  278. }
  279.  
  280. MGLAPI void glScalef(GLfloat x, GLfloat y, GLfloat z)
  281. {
  282.     GLScalef(CC, x, y, z);
  283. }
  284.  
  285. MGLAPI void glScaled(GLdouble x, GLdouble y, GLdouble z)
  286. {
  287.     GLScaled(CC, x, y, z);
  288. }
  289.  
  290. MGLAPI void glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
  291. {
  292.     GLScissor(CC, x, y, width, height);
  293. }
  294.  
  295. MGLAPI void glShadeModel(GLenum mode)
  296. {
  297.     GLShadeModel(CC, mode);
  298. }
  299.  
  300. MGLAPI void glTexCoord2f(GLfloat s, GLfloat t)
  301. {
  302.     GLTexCoord2f(CC, s, t);
  303. }
  304.  
  305. MGLAPI void glTexCoord2fv(GLfloat *v)
  306. {
  307.     GLTexCoord2fv(CC, v);
  308. }
  309.  
  310. MGLAPI void glTexEnvf(GLenum target, GLenum pname, GLfloat param)
  311. {
  312.     GLTexEnvi(CC, target, pname, (GLint)param);
  313. }
  314.  
  315. MGLAPI void glTexEnvi(GLenum target, GLenum pname, GLint param)
  316. {
  317.     GLTexEnvi(CC, target, pname, param);
  318. }
  319.  
  320. MGLAPI void glTexGeni(GLenum coord, GLenum mode, GLenum map)
  321. {
  322.     GLTexGeni(CC, coord, mode, map);
  323. }
  324.  
  325. MGLAPI void glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
  326. {
  327.     GLTexImage2D(CC, target, level, internalformat, width, height, border, format, type, pixels);
  328. }
  329.  
  330. MGLAPI void glTexParameteri(GLenum target, GLenum pname, GLint param)
  331. {
  332.     GLTexParameteri(CC, target, pname, param);
  333. }
  334.  
  335. MGLAPI void glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
  336. {
  337.     GLTexSubImage2D(CC, target, level, xoffset, yoffset, width, height, format, type, pixels);
  338. }
  339.  
  340. MGLAPI void glTranslated(GLdouble x, GLdouble y, GLdouble z)
  341. {
  342.     GLTranslated(CC, x, y, z);
  343. }
  344.  
  345. MGLAPI void glTranslatef(GLfloat x, GLfloat y, GLfloat z)
  346. {
  347.     GLTranslatef(CC, x, y, z);
  348. }
  349.  
  350. MGLAPI void glVertex2f(GLfloat x, GLfloat y)
  351. {
  352.     GLVertex4f(CC, x, y, 0.f, 1.f);
  353. }
  354.  
  355. MGLAPI void glVertex3f(GLfloat x, GLfloat y, GLfloat z)
  356. {
  357.     GLVertex4f(CC, x, y, z, 1.f);
  358. }
  359.  
  360. MGLAPI void glVertex3fv(GLfloat *v)
  361. {
  362.     GLVertex3fv(CC, v);
  363. }
  364.  
  365. MGLAPI void glVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
  366. {
  367.     GLVertex4f(CC, x, y, z, w);
  368. }
  369.  
  370. MGLAPI void glVertex4fv(GLfloat *v)
  371. {
  372.     GLVertex4fv(CC, v);
  373. }
  374.  
  375. MGLAPI void glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
  376. {
  377.     GLViewport(CC, x, y, width, height);
  378. }
  379.  
  380. MGLAPI void * mglCreateContext(int offx, int offy, int w, int h)
  381. {
  382.     CC = (GLcontext)MGLCreateContext(offx, offy, w,h);
  383.     return (void *)CC;
  384. }
  385.  
  386. MGLAPI void * mglCreateContextFromID(GLint id, GLint *w, GLint *h)
  387. {
  388.     CC = (GLcontext)MGLCreateContextFromID(id, w, h);
  389.     return (void *)CC;
  390. }
  391.  
  392.  
  393. MGLAPI void mglDeleteContext(void)
  394. {
  395.     MGLDeleteContext(CC);
  396. }
  397.  
  398. MGLAPI void mglEnableSync(GLboolean enable)
  399. {
  400.     MGLEnableSync(CC, enable);
  401. }
  402.  
  403. MGLAPI void mglExit(void)
  404. {
  405.     MGLExit(CC);
  406. }
  407.  
  408. MGLAPI void * mglGetWindowHandle(void)
  409. {
  410.     return MGLGetWindowHandle(CC);
  411. }
  412.  
  413. MGLAPI void mglIdleFunc(IdleFn i)
  414. {
  415.     MGLIdleFunc(CC, i);
  416. }
  417.  
  418. MGLAPI void mglKeyFunc(KeyHandlerFn k)
  419. {
  420.     MGLKeyFunc(CC, k);
  421. }
  422.  
  423. MGLAPI GLboolean mglLockDisplay(void)
  424. {
  425.     return MGLLockDisplay(CC);
  426. }
  427.  
  428. #ifdef AUTOMATIC_LOCKING_ENABLE
  429. MGLAPI void mglLockMode(GLenum lockMode)
  430. {
  431.     MGLLockMode(CC, lockMode);
  432. }
  433. #endif
  434.  
  435. MGLAPI void mglMainLoop(void)
  436. {
  437.     MGLMainLoop(CC);
  438. }
  439.  
  440. MGLAPI void mglMouseFunc(MouseHandlerFn m)
  441. {
  442.     MGLMouseFunc(CC, m);
  443. }
  444.  
  445. MGLAPI void mglResizeContext(GLsizei width, GLsizei height)
  446. {
  447.     MGLResizeContext(CC, width, height);
  448. }
  449.  
  450. MGLAPI void mglPrintMatrix(GLenum mode)
  451. {
  452.     MGLPrintMatrix(CC, mode);
  453. }
  454.  
  455. MGLAPI void mglPrintMatrixStack(GLenum mode)
  456. {
  457.     MGLPrintMatrixStack(CC,mode);
  458. }
  459.  
  460. MGLAPI void mglSpecialFunc(SpecialHandlerFn s)
  461. {
  462.     MGLSpecialFunc(CC, s);
  463. }
  464.  
  465. MGLAPI void mglSwitchDisplay(void)
  466. {
  467.     MGLSwitchDisplay(CC);
  468. }
  469.  
  470. MGLAPI void mglUnlockDisplay(void)
  471. {
  472.     MGLUnlockDisplay(CC);
  473. }
  474.  
  475. MGLAPI void mglWriteShotPPM(char *filename)
  476. {
  477.     MGLWriteShotPPM(CC, filename);
  478. }
  479.  
  480. MGLAPI void mglTexMemStat(GLint *Current, GLint *Peak)
  481. {
  482.     MGLTexMemStat(CC, Current, Peak);
  483. }
  484.  
  485. MGLAPI void mglSetZOffset(GLfloat offset)
  486. {
  487.     MGLSetZOffset(CC, offset);
  488. }
  489.  
  490. MGLAPI void glColorTable(GLenum target, GLenum internalformat, GLint width, GLenum format, GLenum type, GLvoid *data)
  491. {
  492.     GLColorTable(CC, target, internalformat, width, format, type, data);
  493. }
  494.  
  495. MGLAPI void glColorTableEXT(GLenum target, GLenum internalformat, GLint width, GLenum format, GLenum type, GLvoid *data)
  496. {
  497.     GLColorTable(CC, target, internalformat, width, format, type, data);
  498. }
  499.  
  500.  
  501. /*
  502. ** These function have no hidden context parameter, but are handled the same in case we want to make
  503. ** MiniGL a shared library some day
  504. */
  505.  
  506. MGLAPI void gluLookAt(GLfloat ex, GLfloat ey, GLfloat ez, GLfloat cx, GLfloat cy, GLfloat cz, GLfloat ux, GLfloat uy, GLfloat uz)
  507. {
  508.     GLULookAt(ex, ey, ez, cx, cy, cz, ux, uy, uz);
  509. }
  510.  
  511. MGLAPI void gluPerspective(GLfloat fovy, GLfloat aspect, GLfloat znear, GLfloat zfar)
  512. {
  513.     GLUPerspective(fovy, aspect, znear, zfar);
  514. }
  515.  
  516. /*
  517. ** Additional functions for targetted context creation
  518. */
  519.  
  520. MGLAPI GLboolean mglLockBack(MGLLockInfo *info)
  521. {
  522.     return MGLLockBack(CC, info);
  523. }
  524.  
  525.  
  526. #endif
  527.